﻿@model List<BCDto.FMIS.Certificate.AccountCertificate.AccountCertificateDto>
@{
    Layout = null;
}


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    @{
        int fCount = 0;
        foreach (var item in Model)
        {
            for (int i = 0; i < item.AccountCertificateFlows.Count / 5; i++)
            {

                @if (fCount % 2 == 1)
                {
                    <div style="height:100px;">
                        <span style="float:left;width:50px;border-top:1px solid #333;margin-top:50px;"></span>
                        <span style="float:right;width:50px;border-top:1px solid #333;margin-top:50px"></span>
                    </div>
                }
                @if (fCount > 0 && fCount % 2 == 0)
                {
                    <div style="page-break-after:always;"></div> //分页换页
                }

                <div style="width: 800px;margin: 0 auto;line-height: 35px;">
                    <div style="padding: 10px 0;">
                        <div style="width: 30%;display: inline-block;"></div>
                        <div style="width: 30%;text-align: center;display: inline-block;">
                            <span style="font-size: 40px;">记账凭证</span>
                        </div>
                        <div style="width: 30%;text-align: right;display: inline-block;float:right;">
                            <span style="margin-top:10px;">附件单据: @item.AccountReceiptCount </span>
                        </div>
                    </div>
                    <div style="padding: 10px 0;">
                        @*<div style="width: 30%;text-align: left;display: inline-block;">
            <span>单位：@Model.CompanyName</span>
        </div>*@
                        <div style="width: 30%;text-align: left;display: inline-block;">
                            <span>日期： @item.Year-@item.Month-@item.Day</span>
                        </div>
 
                        <div style="width: 30%;text-align: right;display: inline-block;float:right;">
                            @if (item.AccountCertificateFlows.Count <= 5)
                            {
                                <span>凭证号：@item.AccountCertificateNumber</span>
                            }
                            else
                            {
                                <span>凭证号：@item.AccountCertificateNumber  ( @(i + 1) / @(item.AccountCertificateFlows.Count() / 5) )</span>
                            }
                        </div>
                    </div>
                    <table border="1" style="border-collapse: collapse;width:100%;">
                        <tr style="text-align: center;">
                            <td>摘要</td>
                            <td>科目</td>
                            <td>借方金额</td>
                            <td>贷方金额</td>
                        </tr>
                        @for (int m = 0; m < 5; m++)
                        {
                            int fNo = i * 5 + m;
                            <tr style="height:60px;">
                                <td>@item.AccountCertificateFlows[fNo].Summary</td>
                                <td>@item.AccountCertificateFlows[fNo].AccountNo   @item.AccountCertificateFlows[fNo].AccountName </td>
                                @if (item.AccountCertificateFlows[fNo].HandleDirection == @BCCommon.FMISEnums.DirectionType.Debit)
                                {
                                    <td style="text-align:right">@string.Format("{0:N2}",  item.AccountCertificateFlows[fNo].BorrowerAmount) </td>
                                    <td></td>
                                }
                                else
                                {
                                    <td></td>
                                    <td style="text-align:right">@string.Format("{0:N2}", item.AccountCertificateFlows[fNo].LenderAmount) </td>
                                }
                            </tr>
                        }
                        <tr  style="height:60px;border-bottom:2px solid #333;">
                            <td colspan="2">合计: @item.ChineseAmountSum</td>
                            <td style="text-align:right">@string.Format("{0:N2}", item.BorrowerAmountSum)</td>
                            <td style="text-align:right">@string.Format("{0:N2}", item.LenderAmountSum)</td>
                        </tr>
                    </table>
                    <div style="padding: 10px 0;">
                        <div style="width: 19%;text-align: left;display: inline-block;">
                            <span>主管: </span>
                        </div>
                        <div style="width: 19%;text-align: left;display: inline-block;">
                            <span>记账: </span>
                        </div>
                        <div style="width: 19%;text-align: left;display: inline-block;">
                            <span>审核: @item.ValidationAdminFullName</span>
                        </div>
                        <div style="width: 19%;text-align: left;display: inline-block;">
                            <span>出纳</span>
                        </div>
                        <div style="width: 19%;text-align: left;display: inline-block;">
                            <span>制单: @item.EditerFullName</span>
                        </div>
                    </div>
                </div>

                    fCount++;
                }
            }

        }
</body>
</html> 